package com.chen.tliaswebtest.mapper;

import com.chen.tliaswebtest.pojo.Clazz;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
 * @author chen
 * @version 1.0
 * @create_date 2025/7/24
 * 班级表映射接口
 */
@Mapper
public interface ClazzMapper {
    List<Clazz> selectAllByPage(String name, LocalDate begin,
                                LocalDate end, Integer page, Integer pageSize);

    @Delete("delete from clazz where id = #{id}")
    void deleteById(Integer id);

    void add(Clazz clazz);

    Clazz selectById(Integer id);

    void updateClazz(Clazz clazz);

    List<Clazz> selectAll();

    @Select("select count(*) from clazz where master_id = #{empId}")
    int countByMasterIds(Integer empId);
}
